package com.aaa.controller.api;

import com.aaa.aop.annotation.Log;
import com.aaa.entity.OperLog;
import com.aaa.service.OperLogService;
import com.aaa.vo.OperLogVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;

/**
 * @BelongsPackage: com.aaa.controller.api
 * @Description:
 * @CreateTime: 2023-03-30  09:14
 * @Author: ql
 */
@RestController
@RequestMapping("system/api/operlog")
public class ApiOperLogController {
    @Autowired
    private OperLogService operLogService;
    @PostMapping("/queryOperLogByPage")
    public Result<IPage<OperLog>> queryOperLogByPage(@RequestBody OperLogVo logVo){
        System.out.println("logVo====================== = " + logVo);
        return operLogService.queryOperLogByPage(logVo);
    }

    @DeleteMapping("/deleteOperLogByIds/{id}")
    @Log(title = "批量删除",business_type = "1")
    public Result<String> deleteOperLogByIds(@PathVariable Long[] id){
        System.out.println("=========== " + Arrays.toString(id));
        return operLogService.deleteOperLogByIds(id);
    }
    @DeleteMapping("/delAll")
    @Log(title = "删除所有",business_type = "1")
    public Result<String> delAll(){
        return operLogService.delAll();

    }
}
